package main

import (
	"fmt"
	"time"
)

type B struct {
	name string
}

type A struct {
	b *B
}

var (
	read_chan = make(chan []A, 10)
)

func main() {
	go func() {
		//	for {
		select {
		case a := <-read_chan:
			fmt.Println("a.b:", a[0].b.name)
			fmt.Println("Over")
		}
		fmt.Println("Nothing..")
		//	}
	}()

	//go func() {
	/*b := &B{
		name: "WFF",
	}*/
	a := A{
		//b: b,
		b: &B{
			name: "WFF",
		},
	}

	msg := []A{a}
	read_chan <- msg
	fmt.Println("Start ....")
	for {
		time.Sleep(3 * time.Second)
		fmt.Println("Sleep Over...")
		read_chan <- msg
		fmt.Println("Hello ...")
	}
	//}()

}
